package com.xs.designs.strategy.di2;

import java.util.concurrent.ConcurrentHashMap;

public class HandlerStrategyFactory {
 
    public static final ConcurrentHashMap<StrategyEnum, AbstractHandler> handlerStrategyMap = new ConcurrentHashMap<>();
 
    public static void registerHandlerStrategy(AbstractHandler handler) {
        handlerStrategyMap.put(handler.getHandleStrategy(), handler);
    }
 
    public static AbstractHandler getHandleStrategy(StrategyEnum strategyEnum) {
        return handlerStrategyMap.get(strategyEnum);
    }
}